package com.hclc.entity.model.contans;

/**
 * @author lixin
 * @ClassName: ApiConst
 * @Description: TODO(返回的常量)
 * @date 2019年1月22日 下午4:29:18
 */
public class ApiConst implements java.io.Serializable {
    public static final Long ZERO_LONG = 0L;
    public static final int ZERO = 0;
    public static final double ZERO_DOUBLE = 0.00;
    public static final String ZERO_STRING = "0";

    /**
     * 判断是否为windows系统
     *
     * @return
     */
    public static boolean isWindows() {
        String os = System.getProperty("os.name");
        return os.toLowerCase().startsWith("win");
    }

    public static final String WINDOWS_URL = "C:/hclc/";
    public static final String LINUX_URL = "/home/hjy/tmp/";

    /**
     * 资源文件存放路径
     **/
    public static String url = isWindows() ? WINDOWS_URL : LINUX_URL;
    private static final long serialVersionUID = 1L;

    //启用
    public static final Integer STATUS_ENABLE = 1;
    //禁用
    public static final Integer STATUS_DISABLE = 0;


    //成功
    public static final Integer CODE_SUCC = 0;
    //失败
    public static final Integer CODE_FAIL = 1;
    //token失效
    public static final Integer CODE_FAIL_TOKEN = 2;

    public static final String DESC_SUCC = "操作成功";
    public static final String DESC_FAIL = "操作失败";


    /**
     * 公用字段
     */
    public static final int ENABLE_TRUE = 1;// 有效
    public static final int ENABLE_FALSE = 0;// 无效

    /**
     * ik 分词器规则
     */
    // 分词更精细（建立分词索引时使用）
    public static final String IK_MAX_WORD = "ik_max_word";
    /**
     * ik 分词器规则
     */
    // 分词较粗略（查询使用）
    public static final String IK_SMART = "ik_smart";


    public static final int ONE = 1;

    public static final int PAGE_SIZE = 10;

    /**
     * BigDecimal 默认精度
     */

    public static final int DEFAULT_SCALE = 2;

    /**
     * 逗号分割符号
     */
    public static final String SYMBOL_COMMA = ",";


    /**
     * 手机号正则
     */
    public static final String PHONE_REG = "^[1][3,4,5,6,7,8,9][0-9]{9}$";

    /**
     * 短信验证码正则
     */
    public static final String SMS_CODE_REG = "^[0-9]{6}$";

    /**
     * 支付密码
     */
    public static final String TRANS_PASS = "^[0-9]{6}$";

    /**
     * 推广码正则
     */
    public static final String INVITER_CODE_REG = "^[0-9a-zA-z]{4,6}";

    /**
     * 密码正则
     */
    public static final String PASS_REG = "^[0-9a-zA-z]{6,10}";

    /**
     * 图片正则
     */
    public static final String IMG_REG = ".+(.JPEG|.jpeg|.JPG|.jpg|.GIF|.gif|.BMP|.bmp|.PNG|.png)$";

    /**
     * websocket接口调用，redis身份令牌保存的key
     */
    public static final String WEBSOCKET_KEY = "websocketAuth-";

    /**
     * 匿名用户id
     */
    public static final String ANONYMOUS_USER_ID = "1";

    /**
     * HashMap 初始化大小 (aka 16)
     */
    public static final int DEFAULT_INITIAL_CAPACITY = 1 << 4;
}
